/**
 * Moondance UML modeling tool
 * 
 * This program is free software; you can redistribute it and
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 3
 * of the License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */

package ro.pub.cs.se.moondance.model;

import org.eclipse.swt.graphics.Image;

@SuppressWarnings("unused")
public class UMLState extends UMLEntity {
	private static final long serialVersionUID = 4580844377909347078L;
	private String name;
	private UMLStateMachine StateMachine;
	private Transition Transition;
	private static final Image ICON = createImage("icons/state/state_small.gif");
	private UMLRegion Region;
	private UMLCompositeState CompositeState;
	private UMLDiagram diagram;
	private ModelElement parent;

	public UMLState() {
		super();
	}

	public UMLState(String name) {
		super();
		this.name = name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getName() {
		return name;
	}

	public Image getIcon() {
		return ICON;
	}

	public String getLabelText() {
		return name;
	}

	public String toString() {
		return name;
	}

	public void setTransition(Transition t) {
		this.Transition = t;
	}

	public Transition getTransition() {
		return Transition;
	}

	public void setUMLRegion(UMLRegion Region) {
		this.Region = Region;
	}

	public UMLRegion getRegion() {
		return Region;
	}

	public void setUMLCompositeState(UMLCompositeState cs) {
		this.CompositeState = cs;
	}

	public UMLCompositeState getUMLCompositeState() {
		return CompositeState;
	}

	public void setStateMachine(UMLStateMachine machine) {
		this.StateMachine = machine;
	}

	public UMLStateMachine getStateMachine() {
		return StateMachine;
	}

	public boolean equals(Object o) {
		if (o == null || !(o instanceof UMLState))
			return false;
		UMLState c = (UMLState) o;
		String text1 = getLabelText();
		String text2 = c.getLabelText();
		return text1.equals(text2);
	}

	public void setDiagram(UMLDiagram diagram) {
		this.diagram = diagram;
	}

	public void setParent(ModelElement parent) {
		this.parent = parent;
	}
}
